hvm passthru: Uses of XC_PAGE_MASK should be XC_PAGE_SIZE-1.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 16 Nov 2007 17:09:53 +0000 (17:09 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 16 Nov 2007 17:09:53 +0000 (17:09 +0000)
Signed-off-by: Weidong Han <weidong.han@intel.com>
tools/ioemu/hw/pass-through.c

index 07a308e2ccf692655f74099c0f2c2b971b30e066..304ae3add076ade4fbce5985aff4f2747de3643c 100644 (file)
@@ -130,7 +130,7 @@ void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size,
         ret = xc_domain_memory_mapping(xc_handle, domid,
                 old_ebase >> XC_PAGE_SHIFT,
                 assigned_device->bases[i].access.maddr >> XC_PAGE_SHIFT,
-                (e_size+XC_PAGE_MASK) >> XC_PAGE_SHIFT,
+                (e_size+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT,
                 DPCI_REMOVE_MAPPING);
         if ( ret != 0 )
         {
@@ -143,7 +143,7 @@ void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size,
     ret = xc_domain_memory_mapping(xc_handle, domid,
             assigned_device->bases[i].e_physbase >> XC_PAGE_SHIFT,
             assigned_device->bases[i].access.maddr >> XC_PAGE_SHIFT,
-            (e_size+XC_PAGE_MASK) >> XC_PAGE_SHIFT,
+            (e_size+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT,
             DPCI_ADD_MAPPING);
     if ( ret != 0 )
         PT_LOG("Error: create new mapping failed!\n");